﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
using NS.Utilities;
using NS.BLL.Systems;
using BLL;
using Model;
using NS.Model.Systems;

public partial class Platform_ParkManage : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            InitData();
        }
    }
    private void InitData()
    {
        Order Model = OrderService.GetOrderByOrderID(long.Parse(Request.QueryString["ID"]));
        if (Model != null)
        {
            TrueName.Text = Model.TrueName;
            Mobile.Text = Model.Mobile;
            CarNumber.Text = Model.CarNumber;
            CarType.Text = Model.CarType;
            Address.Text = Model.Address;

            OrderNo.Text = Model.OrderNo;
            State.Text = DictionaryService.GetDicName("订单状态", Model.State.ToString());
            if (Model.AddDate != null)
            {
                AddDate.Text = Model.AddDate.Value.ToString("yyyy-MM-dd HH:mm:ss");
            }
            Interior.Text = Model.Interior == 1 ? "是" : "否";
            Price.Text = Model.Price.ToString();
            if (Model.CouType == 1)
            {
                CouponsMoney.Text = "洗车券";
            }
            else
            {
                CouponsMoney.Text = Model.CouponsMoney.ToString();
            }
            Cash.Text = Model.Cash.ToString();
            Pay.Text = Model.Pay.ToString();
            if (Model.PayDate != null)
            {
                PayDate.Text = Model.PayDate.Value.ToString("yyyy-MM-dd HH:mm:ss");
            }
            PayType.Text = DictionaryService.GetDicName("支付方式", Model.PayType.ToString());
            PayNo.Text = Model.PayNo;

            if (Model.UserID != null)
            {
                UserName.Text = Model.UserName;
                UserID.Text = Model.UserID.ToString().PadLeft(4, '0');
                UserMobile.Text = Model.UserMobile;
                if (Model.StartTime != null)
                {
                    StartTime.Text = Model.StartTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
                }
                if (Model.EndTime != null)
                {
                    EndTime.Text = Model.EndTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
                }
            }
        }
    }
}